﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace IngredSubTool
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public static Session session = new Session();

        public MainWindow()
        {
            //Load data from file.
            DataLoader.LoadCategories();
            DataLoader.LoadSubstitutions();
            DataLoader.LoadComments();
            DataLoader.LoadUnits();
            InitializeComponent();
            PageSwitcher.mainWindow = this;

            UserControl control = new SearchView();
            PageSwitcher.Switch(control);
            session.currentPage = control;
        }

        public void GoToPage(UserControl nextPage)
        {
            this.Content = nextPage;
        }
    }
}
